<?php

// [ 项目运营数据验证器 ]

namespace app\common\validate;
use think\Validate;

class ProjectData extends Validate
{
    // 验证规则
    protected $rule = [
        'project_id' => 'require|integer|max:11',
        'industry'   => 'require|length:2,40',
    ];

    // 错误提示
    protected $message = [
        'project_id.require' => '项目主键必须',
        'project_id.integer' => '项目主键必须为数字',
        'project_id.max'     => '项目主键最大长度[11]',
        
        'industry.require'   => '行业必须',
        'industry.length'    => '行业长度[2~40]',
    ];
    
    // 验证场景
    protected $scene = [
        // 完善项目运营数据
        'complete' => ['project_id','industry'],
    ];
}